import 'dart:convert';

import 'package:ichinesereader/models/student/AssignmentDetail.dart';

ClassAssignmentsResult classAssignmentsResultFromJson(String str) =>
    ClassAssignmentsResult.fromJson(json.decode(str));

String classAssignmentsResultToJson(ClassAssignmentsResult data) =>
    json.encode(data.toJson());

class ClassAssignmentsResult {
  ClassAssignmentsResult({
    this.limit,
    this.page,
    this.count,
    this.list,
  });
  int? limit;
  int? page;
  int? count;
  List<AssignmentDetail>? list;

  factory ClassAssignmentsResult.fromJson(Map<String, dynamic> json) =>
      ClassAssignmentsResult(
        limit: json["limit"],
        page: json["page"],
        count: json["count"],
        list: json["list"] != null
            ? List<AssignmentDetail>.from(
                json["list"].map((x) => AssignmentDetail.fromJson(x)))
            : null,
      );

  Map<String, dynamic> toJson() => {
        "limit": limit,
        "page": page,
        "count": count,
        "list": list != null
            ? List<dynamic>.from(list!.map((x) => x.toJson()))
            : null,
      };
}
